module.exports = {
    style: 'simple',
    async fetch({
        page,
        args
    }) {
        page = page || 1
        let resp = await $http.get(`http://gank.io/api/data/%E7%A6%8F%E5%88%A9/5/${page || ''}`)
        let list = resp.data.results
      
        let items = list.map(photo => {
            return {
                title: photo.type,
                style: "gallery",
                thumb: photo.url,
                author: {
                    name: photo.who,
                },                
                summary: photo._id,
                route: $route('@image', {
                    url: photo.url,
                    date:photo.createdAt
                })
            }
        })
        return {
        
            nextPage: page + 1,
            items: items
        }
    }
}